package com.ruicar.afs.cloud.afscase.dispatch.contract;

import com.ruicar.afs.cloud.common.core.util.IResponse;
import com.ruicar.afs.cloud.common.modules.contract.cms.vo.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author: Lee
 * @date: 2020/5/11 19:39
 * @description: 合同系统聚合层调用接口
 */
@ConditionalOnProperty(name="com.greatwall.services.case-service.url")
@FeignClient(name = "cmsInterfaceFeign", url = "${com.greatwall.services.case-service.url}")
public interface CmsInterfaceFeign {
    /**
     * 贷款进度查询接口
     */
    @ApiOperation("贷款进度查询接口")
    @PostMapping(value = "/aggregation/getLoanProgress")
    public IResponse<CmsProgressInquiryDataVo> getLoanProgress(@RequestParam("idCard") String idCard,
                                                               @RequestParam("applicationNo") String applicationNo,
                                                               @RequestHeader Map<String, String> headers);
    /**
     * 获取客户信息
     */
    @ApiOperation("获取客户信息")
    @PostMapping(value = "/caseCustInfo/getCustomerInfo")
    public IResponse<BasicCustBaseInfoVo> getCustomerInfo(@RequestParam("applyNo") String applyNo,
                                                          @RequestHeader Map<String, String> headers);

    /**
     * 获取客户详细信息
     */
    @ApiOperation("获取客户详细信息")
    @PostMapping(value = "/caseCustInfo/getCustomerDetailInfo")
    public IResponse<InterfaceInfoVo> getCustomerDetailInfo(@RequestParam("applyNo") String applyNo,
                                                            @RequestHeader Map<String, String> headers);

    /**
     * 还款银行卡号查询接口
     */
    @ApiOperation("还款银行卡号查询接口")
    @PostMapping(value = "/CaseBankInfo/getBankNumByCertNoOrApplyNo")
    public IResponse<BankListVo> getBankNumByCertNoOrApplyNo(@RequestParam("applyNo") String applicationNo,
                                                             @RequestParam("certNo") String idCard,
                                                             @RequestHeader Map<String, String> headers);
    /**
     * 通过身份证号获取所有合同
     */
    @ApiOperation("通过身份证号获取所有合同")
    @PostMapping(value = "/CaseBankInfo/getAllContractsByCerNo")
    public IResponse<List<LoanProgressVo>> getAllContractsByCerNo(@RequestParam("certNo") String certNo,
                                                                  @RequestHeader Map<String, String> headers);


    /**
     * 贷款进度查询
     */
    @ApiOperation("贷款进度查询")
    @PostMapping(value = "/CaseBankInfo/getLoanSchedule")
    public IResponse<LoanScheduleVo> getLoanSchedule(@RequestParam("applyNo") String applyNo,
                                                                  @RequestHeader Map<String, String> headers);

    /**
     * 获取见证人姓名
     */
    @ApiOperation("获取见证人姓名")
    @PostMapping(value = "/CaseBankInfo/getWitnessInfo")
    public IResponse<String> getWitnessInfo(@RequestParam("contractNo") String contractNo,
                                                     @RequestHeader Map<String, String> headers);
}
